public class Demo4 {
    public static void main(String args[]) {
        int[] array = {1, 3, 5, 2, 4, 8};
        for (int i = 0;i< array.length;i++) {
            System.out.print(array[i]+" ");
        }
    }

    public static void func(int[] array) {
        int i = 0;
        int j = array.length - 1;
        while (i < j) {
            while (i < j && array[i] % 2 != 0) {
                i++;
            }
            while (i < j && array[j] % 2 == 0) {
                j--;
            }
            int tmp = array[i];
            array[i] = array[j];
            array[j] = tmp;
        }
    }
}


